
from azure.cognitiveservices.speech import SpeechConfig, SpeechSynthesizer

speech_key = "c837ff21-6e5f-49ba-960e-66e2edfe42c7"
service_region = "eastus"  # 根据你的资源区域修改


def list_chinese_voices():
    speech_config = SpeechConfig(subscription=speech_key, region=service_region)
    synthesizer = SpeechSynthesizer(speech_config=speech_config, audio_config=None)
    voices = synthesizer.get_voices_async().get().voices

    # 过滤中文语音（根据语言代码 "zh"）

    for voice in voices:

        print(voice )
        print(voice.locale)



list_chinese_voices()



